import time
def bublek(c):
    ended = True
    while ended:
        ended = False
        for i in range(1, len(c)):
            if c[i] < c[i - 1]:
                c[i], c[i - 1] = c[i-1], c[i]
                ended = True
            

with open('m3_shuffle.txt') as f:
    m3 = list(map(int, f.readlines()))
    t1 = time.time()
    bublek(m3)
    t2 = time.time()
    print('Tretiy fail:', t2 - t1)

with open('m2_reverse.txt') as f:
    m3 = list(map(int, f.readlines()))
    t1 = time.time()
    bublek(m3)
    t2 = time.time()
    print('Ftoroy fail:', t2 - t1)

with open('m1_sorted.txt') as f:
    m3 = list(map(int, f.readlines()))
    t1 = time.time()
    bublek(m3)
    t2 = time.time()
    print('Perviy fail:', t2 - t1)
